/**
 * 作者: LDL
 * 说明:
 * 时间: 2015/7/19 18:54
 */
class UsageOfApply {

}

class ApplyTest{
    def apply() = "This apply is Class"
    def test: Unit ={
        print("test")
    }
}

object ApplyTest{
    var count = 0
    def apply()=new ApplyTest
    def static: Unit ={
        println("I am a static method!!!")
    }
    def incr = {
        count = count +1
    }
}
object UsageOfApply extends App{
    /*ApplyTest.static
    val a = new ApplyTest
    println(a())

    for(i<- 1 to 10){
        ApplyTest.incr
    }
    println(ApplyTest.count)*/
    /*var y = 1
    val fun = (x:Int)=>x+y
    print(fun(5))*/

    val l = List(11,22,33,44,55,66,77,88,99)
    val newList = l.reduce(_+_)
    println(newList)

}